{include file="public/header" select="0" /}
<body class="hide-top bgc">
<div class="submit-container">
    <img src="/static/index/img/icon50.png" alt="">
    <div class="submit-content">
        <div class="submit-hd flex-center">
            <i class="layui-icon layui-icon-left" onclick="goBack()"></i>订单详情
        </div>
        <div class="order-det-staute">
            <p class="order-det-status">{$info.status}</p>
        </div>
        <div class="submit-site flex-layout order-det-site">
            <div>
                <div>
                    <img src="/static/index/img/icon56.png" alt="">{$info.receiver}　{$info.receiver_tel}
                </div>
                <p>{$info.p?$info.p.title:''}
                    {$info.c?$info.c.title:''}
                    {$info.d?$info.d.title:''}
                    {$info.address_details}</p>
            </div>
        </div>
        <div class="submit-pro">
            <ul class="submit-pro-list">
                {foreach name="info.products" item="vo"}
                <li>
                    <p class="flex-center">
                        <img src="{$vo.product_image}" alt="">
                    </p>
                    <div class="center">
                        <p class="multi">{$vo.product_title}</p>
                    </div>
                    <div class="rgt">
                        <p class="price">￥<span>{$vo.price}</span></p>
                        <p>x{$vo.num}</p>
                    </div>
                </li>
                {/foreach}
            </ul>
            {if $info.remark}
            <ul class="submit-pro-form">
                <li>留言：{$info.remark}</li>
            </ul>
            {/if}
        </div>
        <div class="submit-pro">
            <ul class="submit-pro-form">
                <li class="real-money">实付款：<span>￥{$info.real_amount}</span></li>
            </ul>
        </div>
        <ul class="order-det-form">
            <li>
                <p class="name">订单号：</p>
                <p id="sn">{$info.sn}</p>
                <span class="copy flex-center" data-clipboard-target="#sn">复制</span>
            </li>
            <li>
                <p class="name">下单时间：</p>
                <p>{$info.create_time}</p>
            </li>
            {if $info.pay_time}
            <li>
                <p class="name">支付方式：</p>
                <p>{$info.pay_way}</p>
            </li>
            <li>
                <p class="name">支付时间：</p>
                <p>{:date('Y-m-d H:i:s', $info.pay_time)}</p>
            </li>
            {/if}
            {if $info->getData('post_time')}
            <li>
                <p class="name">发货时间：</p>
                <p>{$info.post_time}</p>
            </li>
            {/if}
            {if $info.express}
            <li>
                <p class="name">物流公司：</p>
                <p>{$info.express.title}</p>
            </li>
            {/if}
            {if $info.express_code}
            <li>
                <p class="name">物流单号：</p>
                <p id="express_code">{$info.express_code}</p>
                <span class="copy flex-center" data-clipboard-target="#express_code">复制</span>
            </li>
            {/if}
            {if $info.receipt_time}
            <li>
                <p class="name">收货时间：</p>
                <p>{:date('Y-m-d H:i:s', $info.receipt_time)}</p>
            </li>
            {/if}
            {if $info.refund_time}
            <li>
                <p class="name">退款时间：</p>
                <p>{:date('Y-m-d H:i:s', $info.refund_time)}</p>
            </li>
            {/if}
            {if $info.finish_time}
            <li>
                <p class="name">完成时间：</p>
                <p>{:date('Y-m-d H:i:s', $info.finish_time)}</p>
            </li>
            {/if}
        </ul>
    </div>
</div>
{if $info->uid == $user->id}
{if $info->getData('status') == 1}
<div class="orderDet-footer bottom">
    <p class="flex-center clearOrder" style="border: 1px solid #999;color:#999;" data-id="{$info.id}">取消订单</p>
    <p class="flex-center bc" onclick="load_href('{:url(\'order/payment\')}?id={$info.id}',2)">去支付</p>
</div>
{elseif $info->getData('status') == 3}
<div class="orderDet-footer bottom">
    <p class="flex-center bc receipt" data-id="{$info.id}">确认收货</p>
</div>
{/if}
{/if}
{include file="public/footer" select="0" /}
<script src="/static/index/js/clipboard.min.js"></script>
<script>
    $('.copy').click(function() {
        var clipboard = new ClipboardJS('.copy');
        clipboard.on("success",function(e){
            e.clearSelection();
            layer.msg('复制成功')
        });
        clipboard.on("error",function(e){
            layer.msg('复制失败')
        });
    });

    $('.bottom').on('click', '.clearOrder', function () {
        const id = $(this).attr('data-id');
        edit('clear', id, '确认要取消订单吗？')
    }).on('click', '.receipt', function () {
        const id = $(this).attr('data-id');
        edit('receipt', id, '是否确认收货？')
    }).on('click', '.refund', function () {
        const id = $(this).attr('data-id');
        edit('refund', id, '是否确认退货？')
    });

    function edit(type, id, msg) {
        layer.confirm(msg, {title: '请确认'}, function () {
            _ajax('{:url("order/edit")}',{type: type, id: id});
        });
    }
</script>
</body>
</html>